import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import style from './assets/base/style.css'
import rem from './assets/base/rem'
import fonts from './assets/base/font-awesome.css'
import request from './assets/utils/request'
import tokenCheck from './assets/utils/tokenCheck'

import VueLazyload from 'vue-lazyload'

import { Button, Swipe, SwipeItem, GoodsAction, GoodsActionIcon, GoodsActionButton, List, Cell, CellGroup, Empty, SubmitBar, Checkbox, CheckboxGroup, Grid, GridItem, Card, Icon, ActionSheet, Overlay } from 'vant'

// Tab标签
import { Tab, Tabs } from 'vant'

// Sticky 粘性布局
import { Sticky } from 'vant'

// 搜索
import { Search } from 'vant'

// 加载...
import { Toast } from 'vant'

// 标签
import { Tag } from 'vant'

Vue.prototype.request = request
Vue.prototype.tokenCheck = tokenCheck

Vue.use(VueLazyload, {
  preLoad: 1, // 预加载高度
  error: require('./assets/imgs/swipe-item1.jpg'), // 错误展示图片
  loading: require('./assets/imgs/loading.gif'), // 加载等待图片
  attempt: 1 // 尝试次数
})
Vue.use(Button)

Vue.use(Swipe)
Vue.use(SwipeItem)

Vue.use(GoodsAction)
Vue.use(GoodsActionButton)
Vue.use(GoodsActionIcon)

Vue.use(List)

Vue.use(Cell)
Vue.use(CellGroup)

Vue.use(Empty)

Vue.use(SubmitBar)

Vue.use(Checkbox)
Vue.use(CheckboxGroup)

Vue.use(Grid)
Vue.use(GridItem)

Vue.use(Card)
Vue.use(Tab)
Vue.use(Tabs)
Vue.use(Sticky)
Vue.use(Icon)
Vue.use(Search)

Vue.use(Toast)
Vue.use(Tag)
Vue.use(ActionSheet)
Vue.use(Overlay)

Vue.config.productionTip = false

Vue.prototype.$bus = new Vue()

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
